Skip to content

Include a py.typed marker file with the Python client#100

Open
isomorpheme wants to merge 1 commit intomasterfrom
py-typed
Open

Include a py.typed marker file with the Python client#100
isomorpheme wants to merge 1 commit intomasterfrom
py-typed

Conversation

@isomorpheme
Copy link
Copy Markdown
Contributor

@isomorpheme isomorpheme commented Apr 24, 2026

Closes #8. I've checked that the py.typed file is included when building via Nix, and then using reveal_type on ProducerClient.get_submission_status changes mypy reporting

note: Revealed type is "Any"

into

note: Revealed type is "def (submission_id: Any) -> Any | None"

So this doesn't entirely make types available, due to PyO3/pyo3#5137, but it improves the situation.

@isomorpheme isomorpheme requested a review from Qqwy April 24, 2026 13:32
@isomorpheme
Copy link
Copy Markdown
Contributor Author

I've created #101 as a possible followup step.

features = ["pyo3/extension-module"]
python-source = "python"
module-name = "opsqueue.opsqueue_internal"
include = ["**/py.typed"]
Copy link
Copy Markdown
Contributor Author

@isomorpheme isomorpheme Apr 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know how to check if this does what I expect it to; I don't know how to inspect the results of just build-python. Would appreciate pointers!

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It didn't per se, but I figured it out: just build-python builds a wheel in /tmp and cleans it up before finishing, so instead I used maturin build which outputs it locally. It turns out that .whl files are secretly just zip archives, so I checked and the py.typed is indeed included. 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add py.typed to Python client library

2 participants